//
//  XXViewController.m
//  AVPlayerDemo
//
//  Created by ihope99 on 2017/7/31.
//  Copyright © 2017年 GYP. All rights reserved.
//

#import "XXViewController.h"
#import "GZXPlayerView.h"
#import "Masonry.h"
#import "AppDelegate.h"

#define kScreenWidth [UIScreen mainScreen].bounds.size.width
#define kScreenHeight [UIScreen mainScreen].bounds.size.height

@interface XXViewController ()

@property (nonatomic,strong)GZXPlayerView *mGzxPlayView;

@end

@implementation XXViewController

-(BOOL)prefersStatusBarHidden{
    if (self.mGzxPlayView) {
        if (self.mGzxPlayView.isFullScreen) {
            return YES;
        }else{
            return NO;
        }
    }else{
        return NO;
    }
}
-(void)dealloc{
    [self.mGzxPlayView Cancel];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.mGzxPlayView = [[GZXPlayerView alloc]initWithFrame:CGRectMake(0,100, CGRectGetWidth(self.view.frame), 200)];
    self.mGzxPlayView.mVideoUrlStr = @"http://flv2.bn.netease.com/videolib3/1608/30/zPuaL7429/SD/zPuaL7429-mobile.mp4";
//    self.mGzxPlayView.mVideoUrlStr = @"http://ywd.zai0312.com/data/upload/admin/20170419/58f5c07c7d946.mp4";//特意弄了一个流量小的服务器测试网速不好的情况
    
    self.mGzxPlayView.rootView = self.view;
    self.mGzxPlayView.rootCtrl = self;
    [self.view addSubview:self.mGzxPlayView];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
